Skip to contentSkip to conversation

Change in openvpn[master]: route: Fix a unused-but-set-variable warning on OpenBSD

Openvpn-devel In review flichtenheld (Code Review) 3 participants 8 messages Sep 24, 2025 – Oct 17, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1758727613000.Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email

to review the following change.

Change subject: route: Fix a unused-but-set-variable warning on OpenBSD
......................................................................

route: Fix a unused-but-set-variable warning on OpenBSD

So we could enable -Werror for OpenBSD builds.

Change-Id Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9

---
M src/openvpn/route.c

1 file changed, 1 insertion(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/1214/1

src/openvpn/route.c +1 -0
index 156a99e..05a0c8f 100644
@@ -2221,6 +2221,7 @@
         device = r6->iface;
         gateway_needed = true;
     }
+    (void)device; /* unused on some platforms */
 
     /* if we used a gateway on "add route", we also need to specify it on
      * delete, otherwise some OSes will refuse to delete the route

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9
Gerrit-Change-Number: 1214
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

MaxF has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email )

Change subject: route: Fix a unused-but-set-variable warning on OpenBSD
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9
Gerrit-Change-Number: 1214
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: MaxF <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Wed, 24 Sep 2025 16:19:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 route: Fix a unused-but-set-variable warning on OpenBSD

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

So we could enable -Werror for OpenBSD builds.

Change-Id Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1214
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1214
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
MaxF <[email protected]...>

src/openvpn/route.c +1 -0
index 156a99e..05a0c8f 100644
@@ -2221,6 +2221,7 @@
         device = r6->iface;
         gateway_needed = true;
     }
+    (void)device; /* unused on some platforms */
 
     /* if we used a gateway on "add route", we also need to specify it on
      * delete, otherwise some OSes will refuse to delete the route
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: route: Fix a unused-but-set-variable warning on OpenBSD

This is not my most favourite patch in this series... but the alternative is "more #ifdefs" (nah) or "more code duplication" (nah). In these system dependent parts, some compromises need to be made...

Didn't actually *test* anything, as it's very explicit not doing anything :-) (and BB says "it still compiles and tests fine everywhere").

Your patch has been applied to the master branch.

commit 9243ea88913fc1bed26c25ba7d7b18bb2f16fa4c

Author: Frank Lichtenheld
Date:   Sat Oct 4 16:19:30 2025 +0200
     route: Fix a unused-but-set-variable warning on OpenBSD

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: MaxF <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1214
     Message-Id: <[email protected]...>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59242246/
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw

Re: [Openvpn-devel] [PATCH applied] Re: route: Fix a unused-but-set-variable warning on OpenBSD

Quoted 8 lines · Gert Doering

This is not my most favourite patch in this series... but the alternative is "more #ifdefs" (nah) or "more code duplication" (nah). In these system dependent parts, some compromises need to be made...

Didn't actually *test* anything, as it's very explicit not doing anything :-) (and BB says "it still compiles and tests fine everywhere").

Your patch has been applied to the master branch.

Can you please also apply this to release/2.6? It applies cleanly and otherwise buildbot is unhappy on obsd75. We currently have no easy way to make --enable-werror conditional on the branch.

Thanks,
Frank

Quoted 13 lines

commit 9243ea88913fc1bed26c25ba7d7b18bb2f16fa4c

Author: Frank Lichtenheld
Date:   Sat Oct 4 16:19:30 2025 +0200
     route: Fix a unused-but-set-variable warning on OpenBSD

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: MaxF <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1214
     Message-Id: <[email protected]...>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59242246/
     Signed-off-by: Gert Doering <[email protected]...>
Signature · 1 line
  Frank Lichtenheld
#6 lore raw

Re: [Openvpn-devel] [PATCH applied] Re: route: Fix a unused-but-set-variable warning on OpenBSD

Hi,

Quoted 5 lines · Frank Lichtenheld
Quoted 4 lines · Gert Doering

This is not my most favourite patch in this series... but the alternative is "more #ifdefs" (nah) or "more code duplication" (nah). In these system dependent parts, some compromises need to be made...

Quoted 8 lines
Quoted 4 lines

Didn't actually *test* anything, as it's very explicit not doing anything :-) (and BB says "it still compiles and tests fine everywhere").

Your patch has been applied to the master branch.

Can you please also apply this to release/2.6? It applies cleanly and otherwise buildbot is unhappy on obsd75. We currently have no easy way to make --enable-werror conditional on the branch.

Makes sense.

So here we go:

commit dca6b03098ab0f3ef808c891673305651dc6704a (HEAD -> release/2.6)

Author: Frank Lichtenheld <[email protected]...>
Date:   Sat Oct 4 16:19:30 2025 +0200

route: Fix a unused-but-set-variable warning on OpenBSD

So we could enable -Werror for OpenBSD builds.

Change-Id: Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9

"stared at diff", compile tested on OpenBSD 7.6

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#7 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by MaxF

Change subject: route: Fix a unused-but-set-variable warning on OpenBSD
......................................................................

route: Fix a unused-but-set-variable warning on OpenBSD

So we could enable -Werror for OpenBSD builds.

Change-Id Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1214
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59242246/

---
M src/openvpn/route.c

1 file changed, 1 insertion(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/1214/2

src/openvpn/route.c +1 -0
index 156a99e..05a0c8f 100644
@@ -2221,6 +2221,7 @@
         device = r6->iface;
         gateway_needed = true;
     }
+    (void)device; /* unused on some platforms */
 
     /* if we used a gateway on "add route", we also need to specify it on
      * delete, otherwise some OSes will refuse to delete the route

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9
Gerrit-Change-Number: 1214
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: MaxF <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#8 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email )

Change subject: route: Fix a unused-but-set-variable warning on OpenBSD
......................................................................

route: Fix a unused-but-set-variable warning on OpenBSD

So we could enable -Werror for OpenBSD builds.

Change-Id Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1214
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59242246/

---
M src/openvpn/route.c

1 file changed, 1 insertion(+), 0 deletions(-)
src/openvpn/route.c +1 -0
index 156a99e..05a0c8f 100644
@@ -2221,6 +2221,7 @@
         device = r6->iface;
         gateway_needed = true;
     }
+    (void)device; /* unused on some platforms */
 
     /* if we used a gateway on "add route", we also need to specify it on
      * delete, otherwise some OSes will refuse to delete the route

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1214?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic971604beb1320d7b9d6121cd8e8519ccc1a7eb9
Gerrit-Change-Number: 1214
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: MaxF <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>